home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / dviware / ln03 / rmcs / dvitoln03.ch < prev    next >
Text File  |  1991-09-29  |  45KB  |  1,144 lines

  1. *** UNDER DEVELOPMENT ***                         
  2. DVItype change file for LN03 output
  3. This change file has been produced by adding stuff to the Vax/VMS 
  4. change file, originally due to David R. Fuchs. 
  5. It was originally used to produce a special version of DVItype, the
  6. outputs of which were further processed by LN03toPP.PLI, Author: Flavio Rose
  7. of DEC Marlboro
  8. Modified for DVItype version 2.6 by John Sauter, August 3, 1984.
  9. Version 0.8, quick fix to correct bug in rule merging.
  10. Version 0.9, another quick fix to match a Topp bug fix 
  11. (c) 1986 Royal Military College of Science
  12. The current version, still only experimental, was produced to combine
  13. both these phases into one.
  14. Modified for DVItype version 2.7 by B. Hamilton Kelly, March 1986.
  15. (At Royal Military College of Science, Shrivenham, SWINDON, England.)
  16. Minor cosmetic changes (eg 2048 rules, etc.) July 1987
  17. Support for \special added September 1987
  18. Extensive modifications July 88 and March 89.
  19. Support for additional qualifiers August 89.
  20. Support for \specials for changebars added by Robin Fairbairns.
  21. Avoid problems with non-existent glyphs present in some fonts. (April 1990)
  22. Tidy up processing of \special command arguments (December 1990)
  23. Permit use of <physical units> in margin offsets
  24. Avoid hard-wiring of TEX$... logical names
  25. Support virtual fonts
  26. Support \specials for landscape/portrait, mixed on one page
  27. Draw solid rules for glyphs from missing fonts
  28. Optimize access to doubly-indexed arrays, to speed processing
  29. Support DEClaser 2100/2200 (duplex, tray selection, etc)
  30. DVItoLN03 is now at version 4.1
  31.  
  32.  
  33. Further work:
  34. (suggestions possibly welcomed!)
  35.  
  36. @x <BHK 20-SEP-1991> Limbo
  37. % Version 4.0    Cosmetic changes to error messages - new release!!!
  38. @y
  39. % Version 4.0    Cosmetic changes to error messages - new release!!!
  40. % Version 4.0-1  Minor (?!) bug-fixes
  41. % Version 4.0-2  Further corrections to indexing of messages
  42. % Version 4.0-3  Correct bug that rejected fonts > 188 glyphs
  43. % Version 4.0-4  Reorient rules as well as glyphs!
  44. % Version 4.0-5  Need much closed attention to imaging area with mixed
  45. %                orientations!
  46. % Version 4.0-6  PFS commands reset OPM & margins, so need correction
  47. % Version 4.0-7  Trouble caused by fonts which have duplicate characters
  48. % Version 4.0-8  Ensure glyph position checking is against correct limits!
  49. % Version 4.0-9  Add /PAPER_SIZE qualifier; correct duplexing last page
  50. % Version 4.1    (Released 1 Oct 1991)  Added /[NO]VERBOSE qualifier
  51. @z
  52.  
  53. @x <BHK 30-SEP-1991> Limbo
  54. \def\title{DVI$\,$\lowercase{to}$\,$LN03 V4.0}
  55. @y
  56. \def\title{DVI$\,$\lowercase{to}$\,$LN03 V4.1}
  57. @z
  58.  
  59. @x <BHK 30-SEP-1991> Limbo
  60.   \centerline{(Version 4.0, 27th February 1991)}
  61. @y
  62.   \centerline{(Version 4.1, 30th September 1991)}
  63. @z
  64.  
  65. @x <BHK 20-DEC-1990> Limbo
  66. \let\maybe=\iftrue
  67. %\let\maybe=\iffalse
  68. @y Uncomment-out second next line if documentation required of changes only
  69. \let\maybe=\iftrue
  70. \let\maybe=\iffalse
  71. @z
  72.  
  73. Provide support for /VERBOSE qualifier
  74. @x <BHK 30-SEP-1991> S1.
  75. \yskip\hang\&{V4.0} Supports the new DEClaser~2100 and~2200 printers (the
  76. LN05 and LN06) in addition to the traditional LN03.  With the LN06, paper
  77. feed trays may be selected from the command line, and the duplexing
  78. facilities controlled also.  Support for these printers was provided by
  79. Karsten Nyblad
  80. @^Nyblad, Karsten@>
  81. of TFL, the Danish Telecommunication Research Laboratory, and integrated
  82. into this new release with the other features mentioned above.
  83. @y
  84. \yskip\hang\&{V4.0} Supports the new DEClaser~2100 and~2200 printers (the
  85. LN05 and LN06) in addition to the traditional LN03.  With the LN06, paper
  86. feed trays may be selected from the command line, and the duplexing
  87. facilities controlled also.  Support for these printers was provided by
  88. Karsten Nyblad
  89. @^Nyblad, Karsten@>
  90. of TFL, the Danish Telecommunication Research Laboratory, and integrated
  91. into this new release with the other features mentioned above.
  92. \yskip\hang\&{V4.1} Minor bug fixes; to support mixed orientation printing,
  93. the program requires knowledge of the actual paper size upon which the
  94. output is produced, so the \.{/PAPER\_SIZE} qualifier is introduced.  A
  95. \.{/VERBOSE} qualifier is also introduced, such that sites requiring less
  96. screen output can make the default \.{/NOVERBOSE}.
  97. @z
  98.  
  99. @x <BHK 30-SEP-1991> S1.
  100. @d banner=='This is DVItoLN03, Vax/VMS Version 4.0'
  101. @y
  102. @d banner=='This is DVItoLN03, Vax/VMS Version 4.1'
  103. @z
  104.  
  105. Since OPM and margins must be reset after PFS sequences, need to define here
  106. @x <BHK 22-APR-1991 and 20-SEP-1991> S5.
  107. Whenever bitmaps are sent to the printer (in sixel format), it is necessary
  108. to establish the ``printing'' position 29 pixels  above the current
  109. reference point. Despite repeated enquiry of DEC, it has not been
  110. established why this is necessary. Naturally, we call this 29 pixels
  111. |bitmap_offset|.  This same offset also has to be applied to sixel graphics
  112. included through a \.{\\special} command.
  113.  
  114. When the paper orientation is selected, we may define the |page_len| and
  115. |page_wid| in terms of the physical limits of the paper; these sizes are
  116. as follows (for European A4 paper).
  117. @^European A4 paper@>
  118. (These might later become variables, and be alterable by qualifiers in the
  119. command line.)  There is, however, a further complication.  In either printing
  120. orientation, the printable area is of these dimensions; however, this printing
  121. area starts 0.25~inches from the top left corner of the paper \\{in the
  122. orientation it enters the printer}.  Therefore in portrait mode, we can
  123. actually print from (75,75) to (2475,3475), with (300,300) being the
  124. ``normal'' \TeX\ origin, but in landscape mode we can print (35,75) to
  125. (3435,2475), and \TeX's origin should still be at (300,300).
  126. @y
  127. Whenever bitmaps are sent to the printer (in sixel format), it is necessary
  128. to establish the ``printing'' position 29 pixels  below the current
  129. reference point. This is because the printer, apparently arbitrarily, elects
  130. to put the top of the first row of sixels at a height of 70~decipoints above
  131. the current baseline: since DEC's `point' is what \TeX\ calls \.{1bp}, this
  132. offset is $70\over720$in, or $29{1\over6}$ pixels. Naturally, we call this
  133. |bitmap_offset|.  This same offset also has to be applied to sixel
  134. graphics included through a \.{\\special} command.
  135.  
  136. When the paper orientation is selected, we may define the |page_len| and
  137. |page_wid| in terms of the physical limits of the paper; these sizes are
  138. as follows (for ISO [European] A4 and US letter-size paper).
  139. @^European A4 paper@>
  140. @^A4 (ISO, European) paper@>
  141. @^ISO paper sizes@>
  142. @^Paper sizes@>
  143. @^US letter-size paper@>
  144. Variables are set up with the appropriate set of values, depending upon the
  145. value provided with the \.{/PAPER\_SIZE} qualifier.
  146. @.PAPER\_SIZE@>
  147. @:Qualifiers PAPER SIZE}{\quad\.{PAPER\_SIZE}@>
  148. There is, however, a further complication.  In either printing
  149. orientation, the printable area is of these dimensions; however, this printing
  150. area starts 0.25~inches from the top left corner of the paper \\{in the
  151. orientation it enters the printer}.  Therefore in portrait mode, we can
  152. actually print from (75,75) to (2475,3475), with (300,300) being the
  153. ``normal'' \TeX\ origin, but in landscape mode we can print (33,75) to
  154. (3433,2475), and \TeX's origin should still be at (300,300).  (The strange
  155. figure 33 arises from DEC's handling of European A4~paper; with U.S. paper,
  156. \\{without} OPM set, the printable area measures $2400\times3300$
  157. [$8\times11$in], and has an even $1\over4$in margin all round: with A4
  158. paper, the printable area, regardless of orientation, starts the same
  159. $1\over4$in from the leading short edge of the paper, but the printable area
  160. is extended to 3400 pixels $11{1\over3}$in, thus making the left-edge of the
  161. printable area, in landscape orientation, lie $11{7\over12}$in from the
  162. leading edge.  Since A4~paper is 297mm long, this position is therefore
  163. $0{\cdot}10958$in, approximately 33~pixels, from the left-edge.)
  164.  
  165. This is also a convenient time to introduce certain non-printing control
  166. characters, which will later be used to form control sequences and device
  167. control strings (see ISO Std~2022)
  168. @^ISO Standard 2022@>
  169. for controlling device-specific functions of the printer.  The control
  170. sequence defined by |DECOPM_on| sets DEC's Origin Positioning Mode, such
  171. that dimensions are measured from the edge of the paper rather than the
  172. origin of the printable area (defined by |image_wid@t$\times$@>image_ht|).
  173. The |DECSLRM| macro produces code to set the left- and right-margins of the
  174. printable area, whilst |DECSTBM| sets the top- and bottom-margins;
  175. unfortunately, redefining the page format (through a \\{PFS}\dots sequence)
  176. cancels the effect of all of these, so they must be re-issued anew whenever
  177. the printing orientation is changed.
  178. @z
  179.  
  180. Closer attention to detail of imaging area
  181. @x <BHK 18-APR-1991 and 20-SEP-1991> S5.
  182. @d paper_ht=3400                {in pixels}
  183. @d paper_wid=2400
  184. @d y_port_min=75
  185. @d y_land_min=35
  186. @d page_x_min=75
  187. @d y_top=75       {Minimum addressable $y$ pixel}
  188. @d y_bot=paper_ht+y_port_min {Maximum addressable $y$ pixel}
  189. @y
  190. @d A4_image_ht=3400    {in pixels (for European A4 paper)}
  191. @d US_image_ht=3225    {in pixels (for American $8{1\over2}\times11$ paper)}
  192. @d image_wid=2400   {(same value, 2400, for U.S. paper)}
  193. @d y_port_min=75    {Lowest addressable $y$ in portrait mode (75)}
  194. @d A4_y_land_min=33 {Lowest addressable $y$ in landscape mode}
  195. @d US_y_land_min=0
  196. @d page_x_min=75    {Lowest addressable $x$ in portrait mode}
  197. @d A4_right_marg=5  {Distance from highest $x$ to right-edge in portrait mode}
  198. @d US_right_marg=75
  199. @d y_top=75       {Minimum addressable $y$ pixel}
  200. @d y_bot==(image_ht+y_port_min) {Maximum addressable $y$ pixel in either mode}
  201. @d paper_ht==(y_top+image_ht+y_land_min)  {Physical size of paper}
  202. @d paper_wd==(page_x_min+image_wid+right_marg)
  203. @d min_seg_y=0    {Lowest and highest addressable rows, either orientation\dots}
  204. @d max_seg_y=3510 {and whatever the paper type; esed to declare |seg_list|}
  205. @z
  206.  
  207. Since OPM and margins must be reset after PFS sequences, need to define here
  208. @x <BHK 22-APR-1991> S5.
  209. @d PFS_landscape=='?23 J' {Extended A4 paper in landscape orientation}
  210. @d PFS_portrait=='?22 J'  {ditto in portrait; each preceded by |csi|}
  211. @#
  212. @y
  213. @d esc==chr(@"1B)       {The ASCII ESCape character}
  214. @d csi==chr(@"9B)       {Control Sequence Introducer}
  215. @#
  216. @d A4_PFS_landscape==csi+'?23 J' {Extended A4 paper in landscape orientation}
  217. @d A4_PFS_portrait==csi+'?22 J'  {and portrait}
  218. @#
  219. @d US_PFS_landscape==csi+'?21 J' {Extended US letter paper in landscape orientation}
  220. @d US_PFS_portrait==csi+'?20 J'  {and portrait}
  221. @#
  222. @d DECOPM_on==csi+'?52h'      {\&{Set} Origin Placement Mode}
  223. @d DECSLRM(#)==csi,#:1,';',decslrm_end  {Set Left/Right Margins}
  224. @d decslrm_end(#)==#:1,'s'
  225. @d DECSTBM(#)==csi,#:1,';',decstbm_end  {Set Top/Bottom Margins}
  226. @d decstbm_end(#)==#:1,'r'
  227. @#
  228. @z
  229.  
  230. Correct indexing of warning and error messages
  231. @x <BHK 26-MAR-1991> S28.
  232. @:fatal error Font not loaded TFM file}{\qquad\.{TFM file can't be opened}@>
  233. @y
  234. @:fatal error Font not loaded ...}{\quad\.{Font not loaded...}@>
  235. @:fatal error Font not loaded TFM file}{\qquad\.{TFM file can't be opened}@>
  236. @z
  237.  
  238. Correct indexing of warning and error messages
  239. @x <BHK 26-MAR-1991> S41.
  240. 9997: error('---not loaded, TFM file is bad');
  241. @.TFM file is bad@>
  242. @y
  243. 9997: error('---not loaded, TFM file is bad');
  244. @:Error: TFM file is bad}{\quad\.{TFM file is bad}@>
  245. @z
  246.  
  247. Introduce additional variables to support two differing paper sizes
  248. @x <BHK 20-SEP-1991> S54.
  249. @!orientation,@!new_orient,@!cur_orient : page_orientation;
  250. @y
  251. @!orientation,@!new_orient,@!cur_orient : page_orientation;
  252. @!paper_size : page_sizes;
  253. @!image_ht, @!y_land_min, @!right_marg : integer;
  254. @z
  255.  
  256. Introduce additional enumeration type
  257. @x <BHK 20-SEP-1991> S55.
  258. @ This type allows us to keep track of whether characters are currently
  259. being imaged in landscape or portrait orientation.
  260.  
  261. @<Types...@>=
  262. @!page_orientation = (@!portrait,@!landscape);
  263. @y
  264. @ These types allow us to note for what paper size the printer has been
  265. configured, and to keep track of whether characters are currently being
  266. imaged in landscape or portrait orientation. 
  267.  
  268. @<Types...@>=
  269. @!page_sizes = (@!A4,@!US);
  270. @!page_orientation = (@!portrait,@!landscape);
  271. @z
  272.  
  273. Cosmetic change of module name
  274. @x <BHK 20-SEP-1991> S65.
  275. @<Determine the desired |orientation|@>;
  276. @y
  277. @<Determine the desired |orientation| and paper size@>;
  278. @z
  279.  
  280. Correct usage to explicit |term_out|
  281. @x <BHK 30-SEP-1991> S70.
  282.     write_ln(' --- assuming pixel units',crlf);
  283. @y
  284.     write_ln(term_out,' --- assuming pixel units',crlf);
  285. @z
  286.  
  287. Correct usage to explicit |term_out|
  288. @x <BHK 30-SEP-1991> S70.
  289.     write_ln(' --- assuming pixel units',crlf);
  290. @y
  291.     write_ln(term_out,' --- assuming pixel units',crlf);
  292. @z
  293.  
  294. Closer attention to detail of imaging area; use macros for application
  295. elsewhere.  Support /PAPER_SIZE qualifier
  296. @x <BHK 18-APR-1991, 10-MAY-1991 & 20-SEP-1991> S72.
  297. @<Determine the desired |orientation|@>=
  298. if odd(VAX_cli_present('ORIENTATION')) then
  299. begin
  300.   if odd(VAX_cli_present('PORTRAIT')) then orientation:=portrait else
  301.   if odd(VAX_cli_present('LANDSCAPE')) then orientation:=landscape else
  302.   warning('/ORIENTATION must be "PORTRAIT" or "LANDSCAPE"; assuming "PORTRAIT"')
  303. @:Warning: orientation must be}{\quad \.{/ORIENTATION must be ...}@>
  304. end;
  305. if orientation=landscape then
  306. begin page_len:=paper_wid+page_x_min; page_wid:=paper_ht+y_land_min;
  307.   y_min:=page_x_min; x_min:=y_land_min end else
  308. begin page_len:=paper_ht+y_port_min; page_wid:=paper_wid+page_x_min;
  309.   y_min:=y_port_min; x_min:=page_x_min end;
  310. @y
  311. @d set_landscape_limits==begin page_len:=image_wid+page_x_min;
  312.                            page_wid:=image_ht+y_land_min;
  313.                            y_min:=page_x_min;
  314.                            x_min:=y_land_min
  315.                          end
  316. @d set_portrait_limits==begin page_len:=image_ht+y_port_min;
  317.                           page_wid:=image_wid+page_x_min;
  318.                           y_min:=y_port_min;
  319.                           x_min:=page_x_min
  320.                         end
  321.  
  322. @<Determine the desired |orientation| and paper size@>=
  323. if odd(VAX_cli_present('PAPER_SIZE.US')) then
  324. begin {Using US letter-size paper $11\times8{1\over2}$in}
  325.   image_ht := US_image_ht; y_land_min := US_y_land_min;
  326.   right_marg := US_right_marg; paper_size := US;
  327. end else
  328. begin {Assume ISO A4 paper size $297\times210$mm}
  329.   image_ht := A4_image_ht; y_land_min := A4_y_land_min;
  330.   right_marg := A4_right_marg; paper_size := A4;
  331. end;
  332. if odd(VAX_cli_present('ORIENTATION')) then
  333. begin
  334.   if odd(VAX_cli_present('PORTRAIT')) then orientation:=portrait else
  335.   if odd(VAX_cli_present('LANDSCAPE')) then orientation:=landscape else
  336.   warning('/ORIENTATION must be "PORTRAIT" or "LANDSCAPE"; assuming "PORTRAIT"')
  337. @:Warning: orientation must be}{\quad \.{/ORIENTATION must be ...}@>
  338. end;
  339. if orientation=landscape then set_landscape_limits else set_portrait_limits;
  340. @z
  341.  
  342. Correct usage to explicit |term_out|
  343. @x <BHK 30-SEP-1991> S73.
  344.     write_ln(' --- assuming scaled points',crlf);
  345. @y
  346.     write_ln(term_out,' --- assuming scaled points',crlf);
  347. @z
  348.  
  349. Correct usage to explicit |term_out|
  350. @x <BHK 30-SEP-1991> S73.
  351.     write_ln(' --- assuming scaled points',crlf);
  352. @y
  353.     write_ln(term_out,' --- assuming scaled points',crlf);
  354. @z
  355.  
  356. Correct indexing of warning message
  357. @x <BHK 25-MAR-1991> S87.
  358. @:Warning: checksum doesn't match}{\quad\.{checksum doesn't match}@>
  359. @y
  360. @:Warning: checksum doesn\'t match ...}{\quad\.{checksum doesn't match...}@>
  361. @:Warning: checksum doesn\'t match previous def}{\qquad\.{previous definition}@>
  362. @z
  363.  
  364. Correct indexing of warning message
  365. @x <BHK 25-MAR-1991> S91.
  366. @:Warning: checksum doesn\'t match}{\quad\.{checksum doesn't match}@>
  367. @y
  368. @:Warning: checksum doesn\'t match in TFM file}{\qquad\.{in TFM file}@>
  369. @z
  370.  
  371. Closer attention to detail of imaging area
  372. @x <BHK 18-APR-1991 & 20-SEP-1991> S94.
  373.   @!seg_list : array [y_land_min..paper_ht+y_port_min] of ^segment;
  374. @y
  375.   @!seg_list : array [min_seg_y..max_seg_y] of ^segment;
  376. @z
  377.  
  378. Closer attention to detail of imaging area
  379. @x <BHK 18-APR-1991> S95.
  380.   for k:=y_land_min to paper_ht+y_port_min do seg_list[k]:=nil;
  381. @y
  382.   for k:=y_land_min to image_ht+y_port_min do seg_list[k]:=nil;
  383. @z
  384.  
  385. Some of these characters are now defined much earlier
  386. @x <BHK 22-APR-1991> S101.
  387. @d esc==chr(@"1B)       {The ASCII ESCape character}
  388. @d csi==chr(@"9B)       {Control Sequence Introducer}   
  389. @y
  390. @z
  391.  
  392. Note whether the character packet was used \\{this time}
  393. @x <BHK 02-MAY-1991> S129.
  394. ch_loc[char_num]:=end_of_packet-packet_length;
  395. with glyph_map(TeX_font)(char_num) do
  396.   if loaded=wanted then
  397.   begin
  398.      base:=ras_beg+ras_len;@/
  399.      @<Process |tfm_width| information@>;
  400.      @<Validate size of character's glyph@>;
  401.      @<Complete remainder of Character Definition parameters@>;
  402.      @<Read and translate raster description@>;
  403.      @<Calculate the number of bytes of rasters transferred@>;
  404.      @<Complete the entry in the font character directory@>
  405. @y
  406. packet_used:=false;
  407. with glyph_map(TeX_font)(char_num) do
  408.   if loaded=wanted then
  409.   begin
  410.      base:=ras_beg+ras_len;@/
  411.      @<Process |tfm_width| information@>;
  412.      @<Validate size of character's glyph@>;
  413.      @<Complete remainder of Character Definition parameters@>;
  414.      @<Read and translate raster description@>;
  415.      @<Calculate the number of bytes of rasters transferred@>;
  416.      @<Complete the entry in the font character directory@>;
  417.      packet_used:=true
  418. @z
  419.  
  420. Ensure first record of an included sixels file can be 256 chars long
  421. Provide support for /VERBOSE qualifier
  422. @x <BHK 25-MAR-1991 & 30-SEP-1991> S179.
  423.     monitor(' ('+def_file_name);
  424.     print_ln('Sixel graphics included from: ',def_file_name);
  425. @.Sixel graphics included...@>
  426.     reset(sixel_file);
  427.     write(ln3_file,csi,y_position:1,'d',csi,cur_seg^.xs:1,'`');
  428. @y
  429.     if verbose then monitor(' ('+def_file_name);
  430.     print_ln('Sixel graphics included from: ',def_file_name);
  431. @.Sixel graphics included...@>
  432.     reset(sixel_file);
  433.     write_ln(ln3_file,csi,y_position:1,'d',csi,cur_seg^.xs:1,'`');
  434. @z
  435.  
  436. Provide support for /VERBOSE qualifier
  437. @x <BHK 30-SEP-1991> S179.
  438.     monitor(') ');
  439. @y
  440.     if verbose then monitor(') ');
  441. @z
  442.  
  443. Closer attention to detail of imaging area
  444. PFS commands reset OPM and margin, so must override.  Track paper size
  445. @x <BHK 22-APR-1991> S183.
  446.     write_ln(ln3_file,csi,PFS_landscape);
  447.     page_len:=paper_wid+page_x_min; page_wid:=paper_ht+y_land_min;
  448.     y_min:=page_x_min; x_min:=y_land_min
  449.   end else
  450.   begin
  451.     write_ln(ln3_file,csi,PFS_portrait);
  452.     page_len:=paper_ht+y_port_min; page_wid:=paper_wid+page_x_min;
  453.     y_min:=y_port_min; x_min:=page_x_min
  454. @y
  455.     if paper_size = US then
  456.       write(ln3_file,US_PFS_landscape,DECOPM_on)
  457.     else
  458.       write(ln3_file,A4_PFS_landscape,DECOPM_on);
  459.     set_landscape_limits;
  460.     write_ln(ln3_file,DECSLRM(x_min)(page_wid),DECSTBM(y_min)(page_len))
  461.     {Set page limits}
  462.   end else
  463.   begin
  464.     if paper_size = US then
  465.       write(ln3_file,US_PFS_portrait,DECOPM_on)
  466.     else
  467.       write(ln3_file,A4_PFS_portrait,DECOPM_on);
  468.     set_portrait_limits;
  469.     write_ln(ln3_file,DECSLRM(x_min)(page_wid),DECSTBM(y_min)(page_len))
  470.     {Set page limits}
  471. @z
  472.  
  473. Correct handling of last recto page when duplexing
  474. @x <BHK (from Karsten Nyblad) 20-SEP-1991> S196.
  475.   if ptr_blanks>0 then
  476.     if blank_follows[ptr_blanks]=cur_loc_after_bop then
  477.     begin
  478.       decr(ptr_blanks); {and remain in simplex mode}
  479.       if print_mode>=duplex_master_normal then
  480.         write(ln3_file,' ',FF) {eject blank page for \\{verso} master}
  481.     end else
  482.     begin
  483.       write(ln3_file,csi,print_mode:1,' x');
  484.       duplex_to_be_reset:=false
  485.     end
  486. @y
  487.   begin
  488.     duplex_to_be_reset:=false;
  489.     if ptr_blanks>0 then
  490.       if blank_follows[ptr_blanks]=cur_loc_after_bop then
  491.       begin
  492.         decr(ptr_blanks); {and remain in simplex mode}
  493.         duplex_to_be_reset:=true;
  494.         if print_mode>=duplex_master_normal then
  495.           write(ln3_file,' ',FF) {eject blank page for \\{verso} master}
  496.       end else
  497.         write(ln3_file,csi,print_mode:1,' x')
  498.     else
  499.       write(ln3_file,csi,print_mode:1,' x')
  500.   end
  501. @z
  502.  
  503. Correct indexing of warning and error messages
  504. @x <BHK 26-MAR-1991> S209.
  505. warning('more than ',max_rules:1,' rules on page; excess ignored!');
  506. @.more than ... rules@>
  507. @y
  508. warning('more than ',max_rules:1,' rules on page; excess ignored!');
  509. @:Warning: more than ... rules}{\quad\.{more than ... rules}@>
  510. @z
  511.  
  512. Correct orientation of rules written when orientation=landscape
  513. @x <BHK 18-APR-1991> S209.
  514. with page_rules[rules_on_page] do begin
  515.         horiz := hhh; vert := vvv; height := hheight;
  516.         width := wwidth; covered := false;
  517.           end;
  518. @y
  519. with page_rules[rules_on_page] do
  520.   if new_orient=orientation then
  521.     begin
  522.         horiz := hhh; vert := vvv; height := hheight;
  523.         width := wwidth; covered := false;
  524.     end else
  525.     if new_orient=landscape then
  526.       begin {landscape rule will be output in portrait orientation}
  527.           vert := paper_ht-hhh-left_marg-top_marg;
  528.           horiz := vvv-hheight+top_marg-left_marg;
  529.           width := hheight; height := wwidth; covered := false;
  530.       end else {portrait rule output in landscape}
  531.       begin
  532.           vert := hhh-wwidth+left_marg-top_marg;
  533.           horiz := paper_ht-vvv-left_marg-top_marg;
  534.           width := hheight; height := wwidth; covered := false;
  535.       end;
  536. @z
  537.  
  538. Correct indexing of warning and error messages
  539. @x <BHK 26-MAR-1991> S233.
  540. pre: begin error('preamble command within a page!'); goto 9998;
  541.   end;
  542. @.preamble command within a page@>
  543. post,post_post: begin error('postamble command within a page!'); goto 9998;
  544. @.postamble command within a page@>
  545.   end;
  546. othercases begin error('undefined command ',o:1,'!');
  547.   goto done;
  548. @.undefined command@>
  549. @y
  550. pre: begin error('preamble command within a page!'); goto 9998;
  551.   end;
  552. @:Error: preamble command within a page}{\quad\.{preamble command within a page}@>
  553. post,post_post: begin error('postamble command within a page!'); goto 9998;
  554. @:Error: postamble command within a page}{\quad\.{postamble command within a page}@>
  555.   end;
  556. othercases begin error('undefined command ',o:1,'!');
  557.   goto done;
  558. @:Error: undefined command}{\quad\.{undefined command}@>
  559. @z
  560.  
  561. Correct indexing of warning and error messages
  562. @x <BHK 26-MAR-1991> S234.
  563. @<Cases for commands |nop|, |bop|, \dots, |pop|@>=
  564. nop: goto done;
  565. bop: begin error('bop occurred before eop!'); goto 9998;
  566. @.bop occurred before eop@>
  567. @y
  568. @<Cases for commands |nop|, |bop|, \dots, |pop|@>=
  569. nop: goto done;
  570. bop: begin error('bop occurred before eop!'); goto 9998;
  571. @:Error: bop occurred before eop}{\quad\\{bop }\.{occurred before }\\{eop}@>
  572. @z
  573.  
  574. Correct orientation of rules written when orientation=landscape
  575. @x <BHK 18-APR-1991> S234.
  576.       @<Combine and...@>@;
  577.       do_page:=true;@/
  578.       @<Output contents of page@>;@/
  579.       write(ln3_file,LF);               {LF after page}
  580.       new_orient:=orientation;
  581.       @<Change page orientation@>;      {reset, if necessary}
  582. @y
  583.       do_page:=true;@/
  584.       @<Output contents of page@>;@/
  585.       new_orient:=orientation;
  586.       @<Change page orientation@>;      {reset, if necessary}
  587.       @<Combine and...@>@;      {Rules always output in default orientation}
  588.       write(ln3_file,LF);               {LF after page}
  589. @z
  590.  
  591. Change imaging area limits whenever the orientation is changed
  592. @x <BHK 10-MAY-1991> S244.
  593. @<Match the \meta{function name} in a \.{\\special}@>=
  594. case spec_cmd of
  595.   spec_land: new_orient:=landscape; {|'landscape'| or |'ln03:landscape'|}
  596.   spec_port: new_orient:=portrait;  {|'portrait'| or |'ln03:portrait'|}
  597. @y
  598. @<Match the \meta{function name} in a \.{\\special}@>=
  599. case spec_cmd of
  600.   spec_land: begin new_orient:=landscape; {|'landscape'| or |'ln03:landscape'|} 
  601.                set_landscape_limits
  602.              end;
  603.   spec_port: begin new_orient:=portrait;  {|'portrait'| or |'ln03:portrait'|}
  604.                set_portrait_limits
  605.              end;
  606. @z
  607.  
  608. Correct indexing of warning and error messages
  609. @x <BHK 26-MAR-1991> S246.
  610. @ @<Finish a command that either sets or puts a character...@>=
  611. if p<0 then p:=255-((-1-p) mod 256)
  612. else if p>=256 then p:=p mod 256; {width computation for oriental fonts}
  613. @^oriental characters@>@^Chinese characters@>@^Japanese characters@>
  614. if (p<font_bc[cur_font])or(p>font_ec[cur_font]) then q:=invalid_width
  615. else q:=cur_font_glyph(p).width;
  616. if q=invalid_width then
  617.   begin error('character ',p:1,' invalid in font ');
  618. @.character $c$ invalid...@>
  619. @y
  620. @ @<Finish a command that either sets or puts a character...@>=
  621. if p<0 then p:=255-((-1-p) mod 256)
  622. else if p>=256 then p:=p mod 256; {width computation for oriental fonts}
  623. @^oriental characters@>@^Chinese characters@>@^Japanese characters@>
  624. if (p<font_bc[cur_font])or(p>font_ec[cur_font]) then q:=invalid_width
  625. else q:=cur_font_glyph(p).width;
  626. if q=invalid_width then
  627.   begin error('character ',p:1,' invalid in font ');
  628. @:Error: character $c$ invalid...}{\quad\.{character $c$ invalid...}@>
  629. @z
  630.  
  631. Correct indexing of warning and error messages
  632. @x <BHK 26-MAR-1991> S248.
  633. @<Finish a command that sets |h:=h+q|, then |goto done|@>=
  634. if (h>0)and(q>0) then if h>infinity-q then
  635.   begin error('arithmetic overflow! parameter changed from ',@|
  636. @.arithmetic overflow...@>
  637. @y
  638. @<Finish a command that sets |h:=h+q|, then |goto done|@>=
  639. if (h>0)and(q>0) then if h>infinity-q then
  640.   begin error('arithmetic overflow! parameter changed from ',@|
  641. @:Error: arithmetic overflow...}{\quad\.{arithmetic overflow...}@>
  642. @z
  643.  
  644. Correct indexing of warning and error messages
  645. @x <BHK 26-MAR-1991> S251.
  646. @ @<Finish a command that sets |v:=v+p|, then |goto done|@>=
  647. if (v>0)and(p>0) then if v>infinity-p then
  648.   begin error('arithmetic overflow! parameter changed from ',
  649. @.arithmetic overflow...@>
  650. @y
  651. @ @<Finish a command that sets |v:=v+p|, then |goto done|@>=
  652. if (v>0)and(p>0) then if v>infinity-p then
  653.   begin error('arithmetic overflow! parameter changed from ',
  654. @:Error: arithmetic overflow...}{\quad\.{arithmetic overflow...}@>
  655. @z
  656.  
  657. Provide support for /VERBOSE qualifier
  658. @x <BHK 30-SEP-1991> S255.
  659.   monitor('Gathering font usage statistics...');
  660. @y
  661.   if verbose then monitor('Gathering font usage statistics...');
  662. @z
  663.  
  664. Certain control sequences now defined in \S5
  665. @x <BHK 22-APR-1991> S266.
  666. character; whilst the end of the font download is marked by the |ST| (String
  667. Terminator) character --- this is preceded by a textual comment.
  668. @y
  669. character; whilst the end of the font download is marked by the |ST| (String
  670. Terminator) character --- this is preceded by a textual comment.
  671.  
  672. Finally, we define the printable area, and designate up to ten downloaded
  673. fonts to be accessible through |SGR| control sequences.
  674. @z
  675.  
  676. Certain control sequences now defined in \S5
  677. @x <BHK 22-APR-1991> S266.
  678. {Set page limits}
  679. write(ln3_file,csi,x_min:1,';',page_wid:1,'s',csi,y_min:1,';',page_len:1,'r');
  680. @<Designate first 10 fonts to SGRs |10..19|@>@;
  681. @y
  682. write(ln3_file,DECSLRM(x_min)(page_wid),DECSTBM(y_min)(page_len));
  683. {Set page limits}
  684. @<Designate first 10 fonts to SGRs |10..19|@>@;
  685. @z
  686.  
  687. Certain control sequences now defined in \S5
  688. @x <BHK 22-APR-1991> S267.
  689. @ We start by writing the LN03 directives to the front of the file.  Since the
  690. introduction of the LN03-Plus, this has been made more complicated, because
  691. the sequence |esc, 'c'| is meaningful (and \&{not} as |RIS|!) when the
  692. LN03-Plus is in the Tektronix emulation mode.  Therefore, we start off by
  693. outputting the sequence |esc, '[!p'| which is DEC's private ``soft terminal
  694. reset'' (|DSCSTR|).  (Note that this sequence uses the ``long-winded'' way of
  695. specifying |csi|; this is because the LN03-plus ignores the eigth bit when it
  696. is emulating a Tektronix terminal.)  However, this won't necessarily reset an
  697. `ordinary' LN03, so we output the ISO-standard |RIS| (Reset Initial State
  698. $\equiv$ |esc,'c'|) sequence as well.
  699.  
  700. There then follow a number of control sequences which set up further
  701. characteristics of the LN03: (1) |'?27h'| is a DEC private control sequence,
  702. |DECPSP|, which selects proportional spacing mode, whereby the printer moves
  703. forward by the recorded width of the character glyph rather than by some fixed
  704. amount after printing; (2) |'11h'| \&{set}s the |PUM| (Positioning Unit Mode),
  705. when set, this mode indicates that ``cursor movement'' sequences work in units
  706. of either decipoints or pixels, which of these is determined by (3) |'7 I'|
  707. which sets the |SSU| (Select Size Unit) to be in units of a single pixel; (4)
  708. |'?52h'| is another DEC private sequence, \&{set}ting the |DECOPM| (Origin
  709. Placement Mode) which places the origin for all measurement to the upper-left
  710. corner of the physical page (the alternative is 0.25 inches from that point).
  711. Finally, the sequence ending in |'t'| contains the |page_len| as a parameter,
  712. and is another DEC private control sequence which sets the |DECLPP| (Lines per
  713. Physical Page) to be the height of the printable area, in pixels.
  714.  
  715. @d DECSTR==esc+'[!p'
  716. @d RIS==esc+'c'
  717. @d DECPSP_on==csi+'?27h'
  718. @d PUM_on==csi+'11h'
  719. @d SSU_pixel==csi+'7 I'
  720. @d DECOPM_on==csi+'?52h'
  721.  
  722. @<Generate \.{LN3} file header@>=
  723. if orientation=landscape then
  724.   write_ln(ln3_file,DECSTR,RIS,csi,PFS_landscape)
  725. else
  726.   write_ln(ln3_file,DECSTR,RIS,csi,PFS_portrait);
  727. @y
  728. @ We start by writing the LN03 directives to the front of the file.  Since the
  729. introduction of the LN03-Plus, this has been made more complicated, because
  730. the sequence |esc, 'c'| is meaningful (and \&{not} as |RIS|!) when the
  731. LN03-Plus is in the Tektronix emulation mode.  Therefore, we start off by
  732. outputting the sequence |esc, '[!p'| which is DEC's private ``soft terminal
  733. reset'' (|DSCSTR|).  (Note that this sequence uses the ``long-winded'' way of
  734. specifying |csi|; this is because the LN03-Plus ignores the eighth bit when it
  735. is emulating a Tektronix terminal.)  However, this won't necessarily reset an
  736. `ordinary' LN03, so we output the ISO-standard |RIS| (Reset Initial State
  737. $\equiv$ |esc,'c'|) sequence as well.
  738.  
  739. After setting the correct printing orientation, there then follow a number
  740. of control sequences which set up further characteristics of the LN03: (1)
  741. |'?27h'| is a DEC private control sequence, |DECPSP|, which selects
  742. proportional spacing mode, whereby the printer moves forward by the recorded
  743. width of the character glyph rather than by some fixed amount after
  744. printing; (2) |'11h'| \&{set}s the |PUM| (Positioning Unit Mode), when set,
  745. this mode indicates that ``cursor movement'' sequences work in units of
  746. either decipoints or pixels, which of these is determined by (3) |'7 I'|
  747. which sets the |SSU| (Select Size Unit) to be in units of a single pixel;
  748. (4) the |DECOPM| (Origin Placement Mode) is \&{set}, which places the origin
  749. for all measurement to the upper-left corner of the physical page (the
  750. alternative is 0.25 inches from that point). Finally, the sequence ending in
  751. |'t'| contains the |page_len| as a parameter, and is another DEC private
  752. control sequence which sets the |DECLPP| (Lines per Physical Page) to be the
  753. height of the printable area, in pixels.
  754.  
  755. @d DECSTR==esc+'[!p'
  756. @d RIS==esc+'c'
  757. @d DECPSP_on==csi+'?27h'
  758. @d PUM_on==csi+'11h'
  759. @d SSU_pixel==csi+'7 I'
  760.  
  761. @<Generate \.{LN3} file header@>=
  762. if orientation=landscape then
  763.   if paper_size = US then
  764.     write_ln(ln3_file,DECSTR,RIS,US_PFS_landscape)
  765.   else
  766.     write_ln(ln3_file,DECSTR,RIS,A4_PFS_landscape)
  767. else
  768.   if paper_size = US then
  769.     write_ln(ln3_file,DECSTR,RIS,US_PFS_portrait)
  770.   else
  771.     write_ln(ln3_file,DECSTR,RIS,A4_PFS_portrait);
  772. @z
  773.  
  774. Provide support for /VERBOSE qualifier
  775. @x <BHK 30-SEP-1991> S283.
  776.     write_ln(term_out,' is virtual',crlf);@/
  777. @y
  778.     if verbose then write_ln(term_out,' is virtual',crlf);@/
  779. @z
  780.  
  781. Provide support for /VERBOSE qualifier
  782. @x <BHK 30-SEP-1991> S316.
  783.   @<Report name of font file in use@> ;
  784.   if file_type=unavailable then
  785.     write(' unavailable; printing rules for glyphs;');
  786.   print(' with '); write_ln(term_out,' loaded with ');
  787. @y
  788.   @<Report name of font file in use@> ;
  789.   if file_type=unavailable then
  790.   begin
  791.     if not verbose then
  792.     begin
  793.       write(term_out,'Font ',name);
  794.       if percent <> 100 then write(term_out,' (at ',percent:1,'%)')
  795.     end;
  796.     write(term_out,' unavailable; printing rules for glyphs;');
  797.     if not verbose then write_ln(term_out,crlf);
  798.   end;
  799.   print(' with '); if verbose then write_ln(term_out,' loaded with ');
  800. @z
  801.  
  802. Suppress checksum warning if either file has zero
  803. @x <BHK 25-MAR-1991> S320.
  804.   if font_check_sum[TeX_font]<>checksum then
  805.       warning('checksum doesn''t match in PK file')
  806. @.checksum doesn't match in PK file@>
  807. @y
  808.   if (font_check_sum[TeX_font]<>0) and (checksum<>0) and
  809.      (font_check_sum[TeX_font]<>checksum) then
  810.       warning('checksum doesn''t match in PK file')
  811. @:Warning: checksum doesn\'t match in PK file}{\qquad\.{in PK file}@>
  812. @z
  813.  
  814. Provide support for /VERBOSE qualifier
  815. @x <BHK 30-SEP-1991> S321.
  816. write(term_out,'Font ',name);
  817. if percent<> 100 then write(' (at ',percent:1,'%)');
  818. @y
  819. if verbose then
  820. begin
  821.   write(term_out,'Font ',name);
  822.   if percent<> 100 then write(term_out,' (at ',percent:1,'%)');
  823. end;
  824. @z
  825.  
  826. Must increment character counter if we're making dummy directory entry
  827. @x <BHK 02-MAY-1991> S325.
  828. @<Generate dummy directory entry for font that won't be used@>=
  829. begin
  830.   @<Create null character locator entry@>;
  831.   loaded:=yes
  832. end
  833. @y
  834. @<Generate dummy directory entry for font that won't be used@>=
  835. begin
  836.   @<Create null character locator entry@>;
  837.   incr(first_txfc); loaded:=yes
  838. end
  839. @z
  840.  
  841. Scream if raster file contains character outside font
  842. Check if glyph has been previously processed
  843. @x <BHK 25-MAR, 02-MAY-1991> S328.
  844. @<Copy glyph from packed file, and find the next one@>=
  845. begin
  846.   repeat
  847.     @<Unpack and write...@>;
  848.     skip_specials
  849.   until (glyph_map(TeX_font)(char_num).loaded<>unused) or
  850.         (flag_byte=pk_post);
  851.   with glyph_map(TeX_font)(char_num) do
  852.   if loaded<>unused then
  853.   begin
  854.     char_code:=first_txfc;
  855.     font_code:=ln_font;
  856.     incr(first_txfc)    {This might later be corrected}
  857.   end;
  858. @y
  859. @<Copy glyph from packed file, and find the next one@>=
  860. begin
  861.   repeat
  862.     @<Unpack and write...@>;
  863.     skip_specials;
  864.     if (flag_byte<>pk_post) then
  865.     begin
  866.       if (char_num<font_bc[TeX_font]) or (char_num>font_ec[TeX_font]) then
  867.         abort('bad pk file, illegal character (',char_num:1,')');
  868. @:fatal error Bad pk file illegal character}{\qquad\.{illegal character}@>
  869.       if not packet_used then {Packet wasn't copied...}
  870.         if (glyph_map(TeX_font)(char_num).loaded<>unused) then
  871.           warning('glyph ',char_num:1,
  872.                         ' has multiple definitions; later one(s) ignored')
  873. @:warning glyph has multiple}{\quad\.{glyph $c$ has multiple definitions}@>
  874.     end
  875.   until packet_used or (flag_byte=pk_post);
  876.   with glyph_map(TeX_font)(char_num) do
  877.   if loaded<>unused then
  878.   begin
  879.     char_code:=first_txfc;
  880.     font_code:=ln_font;
  881.     incr(first_txfc) {Count character added to directory, etc}
  882.   end;
  883. @z
  884.  
  885. Suppress checksum warning if either file has zero
  886. @x <BHK 25-MAR-1991> S333.
  887. @<Read character directory from |pxl_file|@>=
  888.  
  889. move_to_pxl(pxl_size-16);
  890. if font_check_sum[TeX_font]<>long_pxl(pxl_ptr) then
  891.   warning('checksum doesn''t match in PXL file');
  892. @.checksum doesn't match in PXL file@>
  893. @y
  894. @<Read character directory from |pxl_file|@>=
  895. move_to_pxl(pxl_size-16); i:=long_pxl(pxl_ptr); {Read checksum from file}
  896. if (font_check_sum[TeX_font]<>0) and (i<>0) and
  897.    (font_check_sum[TeX_font]<>i) then
  898.   warning('checksum doesn''t match in PXL file');
  899. @:Warning: checksum doesn\'t match in PXL file}{\qquad\.{in PXL file}@>
  900. @z
  901.  
  902. Correct bug with fonts that require an overflow beyond 188 glyphs
  903. @x <BHK 17-APR-1991> S334.
  904. The character numbers will be those of the LN03 font file, having already been
  905. mapped to these during the mapping phase; therefore, if the lowest character
  906. number used is |= left_first| then we must be starting a new font, so must
  907. initialize the empty font file and indicate that this is a |GL| font
  908. (left-hand half of eight-bit character table).
  909.  
  910. @<Determine lowest and highest characters used in the \TeX\ font@>=
  911. first_txfc:=-1; last_txfc:=-1;      {For |ln_font|}
  912. @y
  913. The character numbers will be those of the LN03 font file, having already been
  914. mapped to these during the mapping phase; therefore, if the lowest character
  915. number used is |= left_first| then we must be starting a new font, so must
  916. initialize the empty font file and indicate that this is a |GL| font
  917. (left-hand half of eight-bit character table).
  918.  
  919. If the \TeX\ font contained more than 188 glyphs that were used, it will
  920. have been mapped to \&{two} LN03 fonts: |overflow_font| will be set true
  921. when determining which characters were used in the overflow portion (the
  922. first font using all of |left_first..right_first| and
  923. |left_last..right_last|, since such a large font will never be ``fitted in''
  924. along with other fonts mapped to an LN03 font.
  925.  
  926. @<Determine lowest and highest characters used in the \TeX\ font@>=
  927. first_txfc:=-1; last_txfc:=-1; overflow_font:=false;    {For |ln_font|}
  928. @z
  929.  
  930. Correct bug with fonts that require an overflow beyond 188 glyphs
  931. @x <BHK 17-APR-1991> S335.
  932. @ As we cycle through all the allocated characters, we note each code in turn,
  933. thus determining the highest code used.  We also note the lowest one when we
  934. meet the first code used.  If the |TeX_font| extends into a second |ln_font|,
  935. the corresponding information will be recorded in |final_txfc| and |txfc_next|,
  936. respectively.
  937.  
  938. @<Note |last_txfc|, and set |first_txfc| for first character@>=
  939. if loaded = wanted then
  940. begin if txf_to_lnf[font_code]=ln_font then
  941.   begin if first_txfc=-1 then first_txfc:=char_code;
  942.     last_txfc:=char_code; font_code:=ln_font
  943.   end
  944. @y
  945. @ As we cycle through all the allocated characters, we note each code in turn,
  946. thus determining the highest code used (if this is |right_last| then any
  947. subsequent character \\{in this font} will belong to the overflow portion,
  948. in font |ln_font+1|).  We also note the lowest one when we
  949. meet the first code used.  If the |TeX_font| extends into a second |ln_font|,
  950. the corresponding information will be recorded in |final_txfc| and |txfc_next|,
  951. respectively.
  952.  
  953. @<Note |last_txfc|, and set |first_txfc| for first character@>=
  954. if loaded = wanted then
  955. begin if not overflow_font then
  956.   begin if first_txfc=-1 then first_txfc:=char_code;
  957.     last_txfc:=char_code; font_code:=ln_font;
  958.     overflow_font:= char_code=right_last
  959.   end
  960. @z
  961.  
  962. Correct bug with fonts that require an overflow beyond 188 glyphs
  963. @x <BHK 17-APR-1991> S337.
  964. \yskip\hang|end_txf| This is |true| if the last character of the present
  965. |TeX_font| is the last character mapped to |ln_font|.
  966.  
  967. @<Local variables of |add_txf_to_lnf|@>==
  968. @!first_txfc, @!last_txfc : integer;
  969. @!txfc_next, @!final_txfc : integer;
  970. @!begin_txf, @!end_txf : boolean;
  971. @y
  972. \yskip\hang|end_txf| This is |true| if the last character of the present
  973. |TeX_font| is the last character mapped to |ln_font|.
  974.  
  975. \yskip\hang|overflow_font| Set |true| when we're determining the first and
  976. last characters used in the second LN03 font (|ln_font+1|) into which a font
  977. of more than 188 glyphs has overflowed.
  978.  
  979. \yskip\hang|packet_used| Set |true| iff a character packet, taken from a
  980. packed pixel file, corresponds to a |wanted| character, and is downloaded.
  981. If a second packet with the same |char_num| is encountered, the |loaded|
  982. field will already have been set to |yes| or |no|, and the packet will be
  983. skipped.  This permits us to detect duplicate characters (and ensure that
  984. we still process \\{all} characters actually used).
  985.  
  986. @<Local variables of |add_txf_to_lnf|@>==
  987. @!first_txfc, @!last_txfc : integer;
  988. @!txfc_next, @!final_txfc : integer;
  989. @!begin_txf, @!end_txf : boolean;
  990. @!overflow_font : boolean;
  991. @!packet_used : boolean;
  992. @z
  993.  
  994. Provide support for /VERBOSE qualifier
  995. @x <BHK 30-SEP-1991> S338.
  996. write_ln(term_out,rasters:0,' bytes of rasters (',font_occupancy[TeX_font]:1,
  997.                           ' characters)' ,crlf);
  998. @y
  999. if verbose then write_ln(term_out,rasters:0,' bytes of rasters (',
  1000.                           font_occupancy[TeX_font]:1,' characters)' ,crlf);
  1001. @z
  1002.  
  1003. Character counter wasn't increment for missing characters!
  1004. @x <BHK 02-MAY-1991> S343.
  1005.       warning('Font ',name,' doesn''t contain character ',char_num:1,crlf);
  1006. @:Warning: Font doesn't contain character}{\quad\.{Font doesn't contain...}@>
  1007.       @<Decide whereabouts to download the character@>;
  1008.       @<Finish off any previous half font on LN03@>;
  1009.       tfm_width := width;
  1010.       num_cols := pixel_width;
  1011.       base := ras_beg + ras_len;
  1012.       @<Create null character locator entry@>;
  1013.       char_code:=first_txfc; font_code:=ln_font
  1014. @y
  1015.       warning('Font ',name,' doesn''t contain character ',char_num:1,crlf);
  1016. @:Warning: Font doesn't contain character}{\quad\.{Font doesn't contain...}@>
  1017.       @<Decide whereabouts to download the character@>;
  1018.       @<Finish off any previous half font on LN03@>;
  1019.       tfm_width := width;
  1020.       num_cols := pixel_width;
  1021.       base := ras_beg + ras_len;
  1022.       @<Create null character locator entry@>;
  1023.       char_code:=first_txfc; font_code:=ln_font;
  1024.       incr(first_txfc)
  1025. @z
  1026.  
  1027. Must count character's addition to directory entry, etc
  1028. @x <BHK 02-MAY-1991> S344.
  1029.     move_to_pxl(addr*4);
  1030.     char_code:=to_where;@/
  1031.     @<Process |tfm_width| information@>;
  1032.     @<Validate size of character's glyph@>;
  1033.     @<Complete remainder of Character Definition parameters@>;
  1034.     @<Copy the rasters themselves@>;
  1035.     @<Calculate the number of bytes of rasters transferred@>;
  1036.     @<Complete the entry in the font character directory@>
  1037.   end {|with|}
  1038. @y
  1039.     move_to_pxl(addr*4);
  1040.     char_code:=to_where;@/
  1041.     @<Process |tfm_width| information@>;
  1042.     @<Validate size of character's glyph@>;
  1043.     @<Complete remainder of Character Definition parameters@>;
  1044.     @<Copy the rasters themselves@>;
  1045.     @<Calculate the number of bytes of rasters transferred@>;
  1046.     @<Complete the entry in the font character directory@>;
  1047.     incr(first_txfc)
  1048.   end {|with|}
  1049. @z
  1050.  
  1051. Provide support for /VERBOSE qualifier
  1052. @x <BHK 30-SEP-1991> S365.
  1053.         if (pages_counted mod 10)=0 then monitor('.'); {show progress}
  1054. @y
  1055.         if ((pages_counted mod 10)=0) and verbose then
  1056.             monitor('.'); {show progress}
  1057. @z
  1058.  
  1059. Suppress spurious `done' message after N pages processed.
  1060. @x <BHK 25-MAR-1991> S365.
  1061.           monitor('done.'+crlf); term_offset:=0
  1062. @y
  1063. @z
  1064.  
  1065. Provide support for /VERBOSE qualifier
  1066. @x <BHK 30-SEP-1991> S365.
  1067.     monitor('done.'+crlf); term_offset:=0;
  1068. @y
  1069.     if verbose then monitor('done.'+crlf); term_offset:=0;
  1070. @z
  1071.  
  1072. Provide support for /VERBOSE qualifier
  1073. @x <BHK 30-SEP-1991> S373.
  1074. @<Count the pages and move to the starting page@>=
  1075. monitor('Finding starting page...');
  1076. @y
  1077. @<Count the pages and move to the starting page@>=
  1078. if verbose then monitor('Finding starting page...');
  1079. @z
  1080.  
  1081. Provide support for /VERBOSE qualifier
  1082. @x <BHK 30-SEP-1991> S373.
  1083. monitor('found.'+crlf); term_offset:=0
  1084. @y
  1085. if verbose then monitor('found.'+crlf); term_offset:=0
  1086. @z
  1087.  
  1088. Correct the indexing of some warning messages
  1089. @x <BHK 26-MAR-1991> S377.
  1090. if signed_quad<>numerator then
  1091.   warning('numerator doesn''t match the preamble!');
  1092. @:warning numerator doesn't match}{\quad\.{numerator doesn't match...}@>
  1093. if signed_quad<>denominator then
  1094.   warning('denominator doesn''t match the preamble!');
  1095. @:warning denominator doesn't match}{\quad\.{denominator doesn't match...}@>
  1096. if signed_quad<>mag then if new_mag=0 then
  1097.   warning('magnification doesn''t match the preamble!');
  1098. @:warning magnification doesn't match}{\quad\.{magnification doesn't match...}@>
  1099. @y
  1100. if signed_quad<>numerator then
  1101.   warning('numerator doesn''t match the preamble!');
  1102. @:Warning: numerator doesn't match}{\quad\.{numerator doesn't match...}@>
  1103. if signed_quad<>denominator then
  1104.   warning('denominator doesn''t match the preamble!');
  1105. @:Warning: denominator doesn't match}{\quad\.{denominator doesn't match...}@>
  1106. if signed_quad<>mag then if new_mag=0 then
  1107.   warning('magnification doesn''t match the preamble!');
  1108. @:Warning: magnification doesn't match}{\quad\.{magnification doesn't match...}@>
  1109. @z
  1110.  
  1111. Provide support for /VERBOSE qualifier
  1112. @x <BHK 30-SEP-1991> S387.
  1113. @!file_name,@!actual_file_spec,@!log_file_name,
  1114.    @!output_file_name:file_spec;
  1115. @!file_message:file_spec;
  1116. @!cmd_j,@!cmd_k:integer;
  1117. @!ask : boolean;
  1118. @y
  1119. @!file_name,@!actual_file_spec,@!log_file_name,
  1120.    @!output_file_name:file_spec;
  1121. @!file_message:file_spec;
  1122. @!cmd_j,@!cmd_k:integer;
  1123. @!ask,@!verbose : boolean;
  1124. @z
  1125.  
  1126. Correct indexing of warning and error messages
  1127. @x <BHK 26-MAR-1991> S395.
  1128. if not ask then bomb_out('No file name provided');
  1129. @.No file name provided@>
  1130. @y
  1131. if not ask then bomb_out('No file name provided');
  1132. @z
  1133.  
  1134. Provide support for /VERBOSE qualifier
  1135. @x <BHK 30-SEP-1991> S396.
  1136. if odd(VAX_cli_present('LOG')) then
  1137.   VAX_cli_get_value('LOG',log_file_name);
  1138. @y
  1139. if odd(VAX_cli_present('LOG')) then
  1140.   VAX_cli_get_value('LOG',log_file_name);
  1141. verbose := odd(VAX_cli_present('VERBOSE'));
  1142. @z
  1143.  
  1144.